// 封装文章详情相关的接口
import request from "@/utils/request.js";

// 获取文章评论接口
export const getComment = obj => {
  return request({
    method: "GET",
    url: "/app/v1_0/comments",
    params: obj
  });
};

// 发布文章评论接口
export const giveComment = obj => {
  return request({
    method: "POST",
    url: "/app/v1_0/comments",
    data: obj
  });
};

// 对评论点赞
export const pointLike = com_id => {
  return request({
    method: "POST",
    url: "/app/v1_0/comment/likings",
    data: {
      target: com_id
    }
  });
};
// 取消对评论点赞
export const cancelLike = com_id => {
  return request({
    method: "DELETE",
    url: `/app/v1_0/comment/likings/${com_id}`
  });
};
